package com.example.library_base.util

import java.text.SimpleDateFormat
import java.util.*

object DateUtil {

    //根据输入时间戳，转成成固定格式
    fun getFormatDate(format: String?, time: Long): String {
        var mFormat = "yyyy-MM-dd HH:mm:ss"
        if (format != null){
            mFormat = format
        }
        val sdf = SimpleDateFormat(mFormat, Locale.CHINA)
        return sdf.format(Date(time))
    }
}